﻿@model OMS.Models.FullOrderModelView

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@{
    ViewBag.Title = "AddOrder";
}

<h2>This page is appointed for selecting and buying products</h2>


@using (Html.BeginForm())
{
    @Html.ValidationSummary(true) {
        <div align=center>
            Totals <br />
            <table>
                <tr>
                    <td>Order Number</td>
                    <td>@Html.EditorFor(m => m.Order.OrderNumber)</td>
                    <td>@Html.ValidationMessageFor(m => m.Order.OrderNumber)</td>
                </tr>
                <tr>
                    <td>Status</td>
                    @Html.HiddenFor(m => m.Order.Status)
                    <td>@Html.DisplayFor(m => m.Order.Status)</td>
                </tr>
                <tr>
                    <td>Total Price</td>
                    <td>@Html.DisplayFor(m => m.Order.TotalPrice)</td>
                </tr>
                <tr>
                    <td>Total Number of Items</td>
                    <td>@Html.DisplayFor(m => m.Order.NumberOfItems)</td>
                </tr>
                <tr>
                    <td>Date of Ordering</td>
                    @Html.HiddenFor(m => m.Order.DateOfOrdering)
                    <td>@Html.DisplayFor(m => m.Order.DateOfOrdering)</td>
                </tr>
                <tr>
                    <td>Preferable Delivery Date</td>
                    <td>@Html.EditorFor(m => m.Order.PrefDate)</td>
                    <td>@Html.ValidationMessageFor(m => m.Order.PrefDate)</td>
                </tr>
                <tr>
                    <td>Delivery Date</td>
                    @Html.HiddenFor(m => m.Order.DeliveryDate)
                    <td></td>
                </tr>
                <tr>
                    <td>Assignee</td>
                    <td>@Html.DropDownListFor(m => m.Order.Asignee,
                        new SelectList(ViewBag.Merches, "Value", "Text",0))</td>
                    <td>@Html.ValidationMessageFor(m => m.Order.Asignee)</td>
                </tr>
            </table>
        </div>
    <br />
        <div align=center>
            Card Info <br />
            <table>
                <tr>
                    <td>Credit Card Type</td>
                    <td>@Html.DropDownListFor(m => m.CreditCard._Type, new SelectList(
                       new string[] {"Visa","Master Card","American Express","Maestro"},"Visa"))</td>
                    <td>@Html.ValidationMessageFor(m => m.CreditCard._Type)</td>
                </tr>
                <tr>
                    <td>Credit Card Number</td>
                    <td>@Html.EditorFor(m => m.CreditCard.Number)</td>
                    <td>@Html.ValidationMessageFor(m => m.CreditCard.Number)</td>
                </tr>
                <tr>
                    <td>CVV2 Code (What is this?)</td>
                    <td>@Html.EditorFor(m => m.CreditCard.Cv2)</td>
                    <td>@Html.ValidationMessageFor(m => m.CreditCard.Cv2)</td>
                </tr>
                <tr>
                    <td>Expiry Date</td>
                    <td>@Html.EditorFor(m => m.CreditCard.ExpiryDate)</td>
                    <td>@Html.ValidationMessageFor(m => m.CreditCard.ExpiryDate)</td>
                </tr>
                <tr>
                    <td>Start Date (Maestro only)</td>
                    <td>@Html.EditorFor(m => m.CreditCard.StartDate)</td>
                    <td>@Html.ValidationMessageFor(m => m.CreditCard.StartDate)</td>
                </tr>
                <tr>
                    <td>Issue Number (Maestro only)</td>
                    <td>@Html.EditorFor(m => m.CreditCard.IssueNumber)</td>
                    <td>@Html.ValidationMessageFor(m => m.CreditCard.IssueNumber)</td>
                </tr>
            </table>
        </div>
        }
        <button type=submit>Save</button>
}